/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.pscu.smadmin.rest.services;

import com.servicesManagement.model.Client;
import com.servicesManagement.model.Service;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 *
 * @author Aruna
 */
@Path("/json/services")
public class SMAdminServices {

    @POST
    @Path("/create")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
    public Response createService(Service service) {

        try {
            Client client = new Client();
            client.createNewService(service);
        } catch (Exception e) {

            e.printStackTrace();
        }

        return Response.ok().entity(service).build();
    }
}
